package com.example.musicplayer.calculator;

public class Operator {
    public static final String ADD = "+";
    public static final String SUBTRACT = "-";
    public static final String MULTIPLY = "*";
    public static final String DIVIDE = "/";
    public static final String FACTORIAL = "!";
    public static final String POWER = "^";
    public static final String PERCENT = "%";

    public static int getPriority(String op) {
        switch (op) {
            case ADD:
            case SUBTRACT:
                return 4;
            case MULTIPLY:
            case DIVIDE:
                return 6;
            case POWER:
                return 8;
            case FACTORIAL:
            case PERCENT:
                return 10;
            default:
                return 0;
        }
    }

    public static boolean supportOperator(String op) {
        switch (op) {
            case ADD:
            case SUBTRACT:
            case MULTIPLY:
            case DIVIDE:
            case POWER:
            case FACTORIAL:
            case PERCENT:
                return true;
            default:
                return false;
        }
    }
}